{% extends "_base.html" %}

{% block navi %}
    <li class="active"><a href="{{ url_for('web.index') }}">首页</a></li>
    <li><a href="{{ url_for('web.my_collect') }}">收藏</a></li>
    <li><a href="{{ url_for('web.about') }}">关于</a></li>
{% endblock %}

{% block page_content %}
    <div class="col-xs-12">
        <div class="page-header" style="margin-top: -10px;">
            <h3>非诉律师好帮手</h3>
        </div>
        <div>
            <div class="detail-header-time">
                    <div class="year">{{ data.releaseTime[:-3] }}</div>
                    <div class="day">{{ data.releaseTime[-3:-1] }}</div>
            </div>
            <h3>{{ data.stockCode }} {{ data.companyShortName }}</h3>
            <h4>{% if data.type %}[{{ data.type }}] {% endif %}{{ data.title }}</h4>
        </div>
        <div class="download-button">
            <input type="hidden" value="{{ data.id }}" name="sid">

            {% if collected %}
                <button type="button" class="btn btn-default" id="collect-doc" data-mode="no-collect">
                    <span id="collect-span" class="glyphicon glyphicon-heart" aria-hidden="true">已收藏</span>
                </button>
            {% else %}
                <button type="button" class="btn btn-primary" id="collect-doc" data-mode="collect">
                    <span id="collect-span" class="glyphicon glyphicon-plus" aria-hidden="true">加入收藏</span>
                </button>
            {% endif %}

            <button type="button"
                    class="btn btn-primary"
                    onclick="window.location='http://file001.socialcredits.cn/{{ data.file }}?attname={{ '(' + data.companyShortName + '-' + data.stockCode + ')' + data.title }}{{ data.file[data.file.rfind('.'):] }}'">
                <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>下载公告
            </button>
            （文件大小：{{ data.filesize }}）
        </div>

        <div>
            <iframe style="width: 100%; height: 900px;" src="http://file001.socialcredits.cn/{{ data.file }}"></iframe>
        </div>
    </div>
{% endblock %}
